﻿Imports System
Imports System.Drawing
Imports System.Windows.Forms

Namespace System.Workflow.ComponentModel.Design
    Friend MustInherit Class WorkflowLayout
        Implements IDisposable
        ' Methods
        Public Sub New(ByVal serviceProvider As IServiceProvider)
            If (serviceProvider Is Nothing) Then
                Throw New ArgumentNullException("serviceProvider")
            End If
            Me.serviceProvider = serviceProvider
            Me.parentView = [TryCast](Me.serviceProvider.GetService(GetType(WorkflowView)),WorkflowView)
            If (Me.parentView Is Nothing) Then
                Throw New InvalidOperationException(SR.GetString("General_MissingService", New Object() { GetType(WorkflowView).FullName }))
            End If
        End Sub

        Public Overridable Sub Dispose()
        End Sub

        Public MustOverride Function IsCoOrdInLayout(ByVal logicalCoOrd As Point) As Boolean

        Public MustOverride Function MapInCoOrdToLayout(ByVal logicalPoint As Point) As Point

        Public MustOverride Function MapInRectangleToLayout(ByVal logicalRectangle As Rectangle) As Rectangle

        Public MustOverride Function MapOutCoOrdFromLayout(ByVal logicalPoint As Point) As Point

        Public MustOverride Function MapOutRectangleFromLayout(ByVal logicalRectangle As Rectangle) As Rectangle

        Public MustOverride Sub OnPaint(ByVal e As PaintEventArgs, ByVal viewPortData As ViewPortData)

        Public MustOverride Sub OnPaintWorkflow(ByVal e As PaintEventArgs, ByVal viewPortData As ViewPortData)

        Public MustOverride Sub Update(ByVal graphics As Graphics, ByVal reason As LayoutUpdateReason)


        ' Properties
        Public MustOverride ReadOnly Property Extent As Size

        Public MustOverride ReadOnly Property RootDesignerAlignment As Point

        Public MustOverride ReadOnly Property Scaling As Single


        ' Fields
        Protected parentView As WorkflowView
        Protected serviceProvider As IServiceProvider

        ' Nested Types
        Public Enum LayoutUpdateReason
            ' Fields
            LayoutChanged = 0
            ZoomChanged = 1
        End Enum
    End Class
End Namespace

